import request from '../utils/request'
// 获取文章新闻推荐
export const getarticle = (params) => {
  return request({
    url: '/v1_0/articles',
    params
  })
}

// 获取文章不喜欢
export const notLikeArticle = (data) => {
  return request({
    url: '/v1_0/article/dislikes',
    method: 'post',
    data
  })
}

// 举报文章
export const warnArticle = (data) => {
  return request({
    url: '/v1_0/article/reports',
    method: 'post',
    data
  })
}

// 获取文章详情
export const getArticleDetail = (id) => {
  return request({
    url: `/v1_0/articles/${id}`
  })
}

// 对文章点赞
export const likeArticle = (data) => {
  return request({
    url: '/v1_0/article/likings',
    method: 'post',
    data
  })
}

// 对取消文章点赞
export const nolikeArticle = (target) => {
  return request({
    url: `/v1_0/article/likings/${target}`,
    method: 'DELETE'
  })
}

// 对收藏文章
export const collectArt = (data) => {
  return request({
    url: '/v1_0/article/collections',
    method: 'post',
    data
  })
}

// 对取消文章收藏
export const nocollectArt = (target) => {
  return request({
    url: `/v1_0/article/collections/${target}`,
    method: 'DELETE'
  })
}
